import java.util.Objects;
import java.util.Vector;

public class Demo19 {
    public static void main(String[] args) {
        Object lockerA = new Object(); // 1
        Object lockerB = new Object(); // 2

        Thread t1 = new Thread(() -> {
            synchronized (lockerA) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                synchronized (lockerB) {
                    System.out.println("t1");
                }
            }
        });

        Thread t2 = new Thread(() -> {
            synchronized (lockerA) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                synchronized (lockerB) {
                    System.out.println("t2");
                }
            }
        });

        t1.start();
        t2.start();

        Vector<String> v = new Vector<>();
        v.add("hello");
    }
}
